<template>
  <div>
    <el-table
      v-loading="loading"
      :data="tableData"
      border
      ref="tablelayout"
      class="commtable"
    >
      <el-table-column label="Unionid" prop="platName" align="center">
        <template slot-scope="scope">
          {{ scope.row.wxuser.wxid || "-" }}
        </template>
      </el-table-column>
      <el-table-column label="头像" align="center">
        <template slot-scope="scope">
          <img v-if="scope.row.wxuser.photo" :src="scope.row.wxuser.photo" alt="" class="imgmini">
          <span v-else>-</span>
        </template>
      </el-table-column>
      <el-table-column label="昵称" prop="wxuser.name" align="center">
        <template slot-scope="scope">
          <span>{{scope.row.wxuser.name || '-'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="兑奖码" prop="code" align="center" />
    </el-table>
    <!-- <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.page"
      :limit.sync="queryParams.num"
      @pagination="getList"
    /> -->
  </div>
</template>
<script>
import { mapState } from "vuex";
import { drawUserList } from "@/api/active";

export default {
  data() {
    return {
      queryParams: {
        page: 1,
        num: 10,
        id: "",
      },
      total: 0,
      loading: false,
    };
  },

  props: {
    rowid: {
      default: '',
    },
  },

  created() {
    this.queryParams.id = this.rowid;
    this.getList();
  },

  methods: {
    getList() {
      this.loading = true;
      drawUserList(this.queryParams).then((response) => {
        this.tableData = response.data;
        this.loading = false;
      });
    },

    handleQuery() {
      this.queryParams.page = 1;
      this.getList();
    },

    resetQuery() {
      this.isrefresh = true;
      this.resetForm("queryForm");
      this.handleQuery();
    },
    
  },
};
</script>

<style lang="scss" scoped>
.iconbox {
  width: 32px;
  height: 26px;
}
.imgmini {
  width: 40px;
  height: 40px;
  margin: auto;
}
</style>
